import CTextAreaForm from '@/components/CTextAreaForm/CTextAreaForm'
import CSelectFormItem from '@/components/CSelectFormItem/CSelectFormItem'
import useEffectDictPage from '@/useEffect/useEffectDictPage'
import { Col, Form } from '@douyinfe/semi-ui'
import { OptionProps } from '@douyinfe/semi-ui/lib/es/select'

// 获取 下拉选的数据
export function getNotifySearchFormSelectData(modalVisible: boolean) {
  const { dictList } = useEffectDictPage(modalVisible, 'notify_type')
  return { dictList }
}

interface INotifyFormItem {
  dictList: OptionProps[]
}

export default function NotifyFormItem(props: INotifyFormItem) {
  return (
    <>
      <Col span={24}>
        <Form.Input field="title" showClear label="标题" />
      </Col>
      <Col span={24}>
        <CSelectFormItem
          field={'type'}
          label={'通知类型'}
          optionList={props.dictList}
        />
      </Col>
      <Col span={24}>
        <Form.Switch
          field="readFlag"
          label={{
            text: '已读',
          }}
        />
      </Col>
      <Col span={24}>
        <CTextAreaForm></CTextAreaForm>
      </Col>
    </>
  )
}
